home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
201-225
/
225
/
amigatcp
/
src
/
tcptimer.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-13
|
869b
|
42 lines
/* TCP timeout routines */
#include <stdio.h>
#include "machdep.h"
#include "timer.h"
#include "mbuf.h"
#include "netuser.h"
#include "internet.h"
#include "ip.h"
#include "tcp.h"
/* Timer timeout */
void
tcp_timeout(arg)
int *arg;
{
register struct tcb *tcb;
tcb = (struct tcb *)arg;
switch(tcb->state){
case TIME_WAIT: /* 2MSL timer has expired */
close_self(tcb,NORMAL);
break;
default: /* Retransmission timer has expired */
if(tcb->retry < RETRY){
tcb->retry++;
tcb->snd.ptr = tcb->snd.una;
/* Back off on retransmission timer;
* on closed window probes, limit it to
* BACKOFF x the current round trip estimate
*/
tcb->timer.start <<= 1;
if(tcb->snd.wnd == 0)
tcb->timer.start =
min(tcb->timer.start,BACKOFF*tcb->srtt/MSPTICK);
tcp_output(tcb);
} else {
/* Give up */
close_self(tcb,TIMEOUT);
}
}
}